﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/static/include/top.jsp"%>
<script>document.title="数据审核";</script>
<script>
function openEditWin(id){
	openWin("修改详情","${baseURL}/data/edit?id="+id,420,400);
}

function xxx(){
	location.reload(true);
}
</script>
	<table>
		<tbody>
			<tr>
				<th><img src="${ctx}/static/images/pages/cen/rig/ico_01.png" align="absmiddle">&nbsp;处理报表文件</th>
			</tr>
			<tr class="tab_grey">
				<td>
				<form name="searchForm" action="" method="get">
			<input type="hidden" name="p" value="1" />
			开始时间：
			<input	id="searchDate" name="searchDate" onfocus="WdatePicker()" class="Wdate"	value="${formdata.startTime}" type="text">
			<span class="tab_text">结束时间：</span>
			<input	id="endDate" name="endDate" onfocus="WdatePicker()" class="Wdate" value="${formdata.endTime}" type="text">
			
			<a class="tab_but" href="#" onclick="searchForm.action='${baseURL}/data/list';searchForm.submit();return false;">查询</a>
			<a class="tab_but" href="#" onclick="clearInput();return false;">清空</a>
			<a class="tab_but" href="#" onclick="doneByIds('${ctx}')">处理完成</a>
			
		</form>
		
		<script>
		$("#searchDate").val("${param['searchDate']}");
		$("#endDate").val("${param['endDate']}");
		
		
		function clearInput() {
			$("#searchDate").val("");
			$("#endDate").val("");
			
		}
		</script>
		<iframe name="upload" width="0" height="0" frameborder="0"></iframe>
				
				</td>
			</tr>
		</tbody>
	</table>

 
	
  <br />
	<c:if test="${empty obj.operationResult}">
		<b>没有符合条件的记录。</b>
	</c:if>
<c:if test="${not empty obj.operationResult}">
  <table class="tab">
    <tr>
    	<th width="5%"><input type="checkbox" onclick="selectAll(this.checked);"></th>
        <th width="10%">附件名称</th>
		<th width="15%">上传时间</th>
		<th width="20%">上传单位</th>
		<th width="15%">简要说明</th>
		<th width="10%">处理状态</th>
		<th>操作</th>
		
    </tr>
    <c:forEach var="oneRow" items="${obj.operationResult}">
    		
    <tr>
    	<td align="left"><input name="chk" type="checkbox" id="chk" value="${oneRow.attachId}" /></td>
      	<td align="left">${oneRow.attachFilename}</td>
		<td align="left">${oneRow.sysCreateDate}</td>
		<td align="left">${oneRow.userUnit}</td>
		<td align="left">${oneRow.attachExplain}</td>
		<td align="left">
		<c:if test="${oneRow.isDisposal==0}">未处理</c:if>
		<c:if test="${oneRow.isDisposal==1}">已处理</c:if>
		<c:if test="${oneRow.isDisposal==3}">通知</c:if>
		</td>
		<td align="left">
			<a href="${baseURL}/data/download?id=${oneRow.attachId}"><img src="${baseURL}/static/images/tab/ico_01.png" width="16" height="16" border="0" align="absmiddle"/>下载</a>
			<a href="#" onclick="openEditWin('${oneRow.attachId}')"><img src="${baseURL}/static/images/tab/ico_01.png" width="16" height="16" border="0" align="absmiddle"/>修改说明</a>
		</td>
		
    </tr>
    </c:forEach>
    <tr class="tab_grey">
				<td colspan="7" align="center" valign="middle" class="tab_white">
				<div class="pagination"> 
					<%@ include file="../include/listpage.jsp"%>
				</div>
				<div class="clear"></div>
				</td>
			</tr>
  </table>
<script>


function selectAll(checkAllFlag) {
	var checkArray = document.getElementsByName("chk");
	for (var i = 0; i < checkArray.length; i++) {
		checkArray[i].checked = checkAllFlag;
	}
}
function doneByIds(prefix){

	var str="";
	var checkArray = document.getElementsByName("chk");
	for (var i = 0; i < checkArray.length; i++) {
		if(checkArray[i].checked){
			str += checkArray[i].value + ",";
		}
	}
	var dot = str.lastIndexOf(",");
	if(dot==-1){
		layer.alert("请选择要改变状态的附件！");
		return;
	}else{
		str = str.substring(0,dot);
	}
	
	layer.confirm("确定要改变选中附件的状态？", function(){
		var url=prefix+"/data/deal";
		$.post(url,{"idStr":str,},function(data){
			layer.msg("处理成功", 1, 1, function(){
				location.reload(true);
			});			
		},'json');
	});	
}
</script>
</c:if>

<%@ include file="/static/include/bottom.jsp"%>
